package dao.examinfo;

import java.util.List;

import util.paramvo.PageListParamVO;
import vo.ExaminfoVO;

import com.ibatis.sqlmap.client.SqlMapClient;

public class ExaminfoDAOImpl implements ExaminfoDAO{

	private SqlMapClient sqlMapClient;

	public void setSqlMapClient(SqlMapClient sqlMapClient) {
		this.sqlMapClient = sqlMapClient;
	}

	@Override
	public List<ExaminfoVO> getUnapprovalExaminfoList(PageListParamVO param) throws Exception {
		return sqlMapClient.queryForList("examinfo.getUnapprovalExaminfoList", param);
	}

	@Override
	public int countUnapprovalExaminfoList() throws Exception {
		return (Integer) sqlMapClient.queryForObject("examinfo.countUnapprovalExaminfoList");
	}

	@Override
	public void approveExaminfo(ExaminfoVO param) throws Exception {
		sqlMapClient.update("examinfo.approveExaminfo", param);
	}

	@Override
	public ExaminfoVO getExaminfo(int examinfo_no) throws Exception {
		return (ExaminfoVO) sqlMapClient.queryForObject("examinfo.getExaminfo", examinfo_no);
	}

	@Override
	public List<Integer> getWriters(int majorunit_no) throws Exception {
		return sqlMapClient.queryForList("examinfo.getWriters", majorunit_no);
	}
}
